#include "Camera.h"

CCamera::CCamera()
{
	this->m_pos = D3DXVECTOR2(0, 0);
	this->tyle = 0.5;
	m_enable = true;
}

void CCamera::Update(D3DXVECTOR2 pos)
{/*
	if (input->KeyDown(DIK_D))
		this->m_pos.x += BUOCDI * this->tyle;
	if (input->KeyDown(DIK_SPACE))
		this->m_pos.x -= BUOCDI * this->tyle;*/

	if (m_enable && pos.x >= 400)
		m_pos.x = pos.x - 400;
	
}

D3DXVECTOR2 CCamera::GetPosition()
{
	return this->m_pos;
}

D3DXMATRIX CCamera::GetCameraMatrix()
{
	D3DXMATRIX matrix;
	D3DXMatrixTranslation(&matrix, -m_pos.x, -m_pos.y, 1);
	
	return matrix;
}